#!/bin/bash

DISK_THRESHOLD=80
VOLUME=""
VOLUME1=/dev/nvme0n1
VOLUME2=/dev/xvda1
VOLUME3=/dev/vda1

df -Th | grep $VOLUME1 >> /dev/null 2>&1
if [ "$?" = "0" ] && [ "$VOLUME" = "" ]; then
  VOLUME=$VOLUME1
fi

df -Th | grep $VOLUME2 >> /dev/null 2>&1
if [ "$?" = "0" ] && [ "$VOLUME" = "" ]; then
  VOLUME=$VOLUME2
fi

df -Th | grep $VOLUME3 >> /dev/null 2>&1
if [ "$?" = "0" ] && [ "$VOLUME" = "" ]; then
  VOLUME=$VOLUME3
fi

if [ "$VOLUME" = "" ]; then
  echo ""
  echo -e "Cannot found volume"
  echo "VOLUME1: $VOLUME1"
  echo "VOLUME2: $VOLUME2"
  echo "VOLUME2: $VOLUME3"
  echo ""
  exit 1
fi

echo "$VOLUME"
